"""
用户数据模型
"""
from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime

class User(BaseModel):
    """用户模型"""
    id: str
    username: str
    email: Optional[str] = None
    phone: Optional[str] = None
    created_at: datetime
    updated_at: datetime

class UserCredentials(BaseModel):
    """用户凭据模型"""
    username: str
    password: str
    remember_me: bool = False

class UserProfile(BaseModel):
    """用户资料模型"""
    user_id: str
    nickname: str
    avatar: Optional[str] = None
    preferences: dict = {}

class SavedAccount(BaseModel):
    """保存的账号模型"""
    id: str
    username: str
    nickname: str
    last_login: Optional[datetime] = None
    is_active: bool = True